{extend name="common/public" /}
    {block name="content"}
        <div class="widget-body am-fr">
            <div class="am-form-group">
                <div class="am-btn-toolbar">
                    <div class="am-btn-group am-btn-group-xs">
                        <button type="button" onclick="openUrl('{:url(\'add\')}')" class="am-btn am-btn-default am-btn-success"><span class="am-icon-plus"></span> 新增</button>
                    </div>
                </div>
            </div>
        </div>
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title am-fl">基本边框</div>
                    <div class="widget-function am-fr">
                        <a href="javascript:;" class="am-icon-cog"></a>
                    </div>
                </div>
                <div class="widget-body  widget-body-lg am-fr">

                    <table width="100%" class="am-table am-table-compact am-table-bordered tpl-table-black ">
                        <thead>
                        <tr>
                            <th>菜单名</th>
                            <th>菜单级别</th>
                            <th>前台路由地址</th>
                            <th>后台路由地址</th>
                            <th>图标</th>
                            <th>创建时间</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        {php}
                            function menulist($data,$line =''){
                                if($data[0]['level']>1)
                                $line.='---|';
                                foreach($data as $v){
                                    {/php}
                                        <tr class="gradeX">
                                            <td>{$line}{$v.name}</td>
                                            <td>{$v.level}</td>
                                            <td>{$v.router_url}</td>
                                            <td>{$v.back_router}</td>
                                            <td>{$v.icon}</td>
                                            <td>{$v.create_time}</td>
                                            <td>
                                                <div class="tpl-table-black-operation">
                                                    <a href="javascript:;"  onclick="openUrl('{:url(\'edit_view\',['id'=>$v.id])}')">
                                                        <i class="am-icon-pencil"></i> 编辑
                                                    </a>
                                                </div>
                                            </td>
                                        </tr>
                                    {php}
                                    if($v['son']){
                                        menulist($v['son'],$line);
                                    }
                                }
                            }
                            menulist($data);
                        {/php}
                        </tbody>
                    </table>

                </div>
            </div>
        </div>
    {/block}
{/extend}
